package Demo9;

import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:config.properties")//用来告知SPring容器对应的properties文件在哪，让其区读取
public class DBUtil {
    private String url;
    private String username;
    private String password;

    @Override
    public String toString() {
        return "DBUtil{" +
                "url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
